package interfaces;

import exceptions.NoSuchElementException;

public interface QueueStackDeque <String> {

	/**
	 * Adds element of type T to the queue or stack. This is push operation for stack
	 * @param x the element to add
	 * @return true if operation was successful, false otherwise
	 */
	public boolean add(String x);
	
	/**
	 * Gets the element of type T from queue or stack. This is pop() operation for stack and deque for a queue.
	 * @return the removed element.
	 */
	public String remove() throws NoSuchElementException;
	
	/**
	 * Resizes the underlying array if number n of elements exceeds the size of array or is less than 3*n.
	 */
	public void resize();
	
	/**
	 * Returns the length of the array.
	 * @return the length of the array.
	 */
	public int length();
}
